<template>
    <form @submit.prevent="submit">
      <div>
        <label>用户名:</label>
        <input v-model="username" type="text" required />
      </div>
      <div>
        <label>密码:</label>
        <input v-model="password" type="password" required />
      </div>
      <button type="submit">登录</button>
    </form>
  </template>
  
  <script setup lang="ts">
  import { ref } from 'vue'
  
  const username = ref('')
  const password = ref('')
  
  const emit = defineEmits(['submit'])
  
  const submit = () => {
    emit('submit', username.value, password.value)
  }
  </script>

<style scoped>
@import '../styles/login.css';
</style>